package me.trytofeel.service.impl;

import lombok.Data;
import me.trytofeel.bean.User;
import me.trytofeel.dao.UserDao;
import me.trytofeel.service.UserService;

/*
 * 具体的业务实现类
 */
@Data
public class UserServiceImpl implements UserService {
    // 业务实现，要依赖数据层的数据，所以把数据层注入进来
    private UserDao userDao;

    @Override
    public boolean removeUserById(int id) {
        int i = userDao.deleteUserById(id);
        return i > 0;
    }

    @Override
    public User getUserById(int id) {
        User user = userDao.selectUserById(id);
        return user;
    }
}
